[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 flushall()              Flush All Streams and Clear All Buffers

 #include   <stdio.h>

 int        flushall(void);

    flushall() works on input and output streams.  It writes the contents
    of all buffers associated with open output streams to their
    associated files.  It clears the contents of buffers associated with
    open input streams.

       Returns:     The number of open streams.  There is no error
                    return.

         Notes:     All streams remain open after the call to flushall().

                    For output streams, buffers are automatically flushed
                    when they are full, when the streams are closed, or
                    when a program terminates normally.

                    See fflush() for a similar function that works on a
                    specified stream.

   -------------------------------- Example ---------------------------------

    The following statements open two files and flush them both with a
    single call to flushall().

           #include <stdio.h>

           FILE *stream1, *stream2;

           main()
           {
               if ((stream1 = fopen("raw.dta","r")) != NULL &&
                   (stream2 = fopen("update.dta","a+")) != NULL) {


                   flushall();
               }
           }


See Also: fflush()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson